package com.lingo.ffmpegdemo.lg.utils;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author watson
 * @date 2021/6/8 10:17
 * @Description: 视频大小拆分剪切
 **/
public class VedioBig2Mall {

    public static void main(String[] args) throws ParseException {
        String str = "00:43:27";


        SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
        Date date = dateFormat.parse(str);
        for (int i = 0; i < 8; i++) {
            DateTime dateTime = DateUtil.offsetMinute(date, -5 * i);
            String format = dateFormat.format(dateTime);
            System.out.println("format" + format);
            DateTime dateTime1 = DateUtil.offsetMinute(date, -5 * (i + 1));
            String format1 = dateFormat.format(dateTime1);
            System.out.println("format1" + format1);
            System.out.println("=======================================================");
            FfmpegUtils.cutVideoAudio("D:\\ffmpegMedia\\WeChat\\5__01函数.mp4", format1, format);
        }
    }
}
